package com.kfm.pm;

public class Student {

    // 类的字段
    String name;
    double math;
    double chinese;


    // 方法
    public void printTotalScore() {
        System.out.println(name + "的总成绩是" + (math + chinese));
    }

    public void printAvgScore() {
        System.out.println(name + "的平均成绩是" + (math + chinese) / 2);
    }


    public static void main(String[] args) {
        // 创建对象
        Student wy = new Student();
        wy.name = "万叶";
        wy.math = 89.0;
        wy.chinese = 78.9;
        wy.printAvgScore();
        wy.printTotalScore();
    }

    public static void test() {
        System.out.println("test");
    }
}
